﻿using BCCommon.PaymentEnums;
using BCEntity.Common.Payment.AliPayBill;
using BCEntity.Common.Payment.AliPayBill.AliPayBillDetail;
using BCEntity.Common.Payment.AliPayBill.AliPayBillStatistics;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.Common.Payment.AliPayBill
{
    /// <summary>
    /// 支付宝对账单
    /// </summary>
    public interface IAliPayBillData
    {

        /// <summary>
        /// 某一天支付宝支付对账单记录是否存在
        /// </summary>
        /// <param name="tradeDate">交易日期</param>
        /// <param name="aliPayBillType">支付宝支付账单类型</param>
        /// <param name="appType">应用类型</param>
        /// <returns></returns>
        Task<bool> SomeDayBillExists(DateTime tradeDate, AliPayBillType aliPayBillType, SourceAppType appType);
        /// <summary>
        /// 添加支付宝支付对账单记录
        /// </summary>
        /// <param name="billEntity">支付宝对账单</param>
        /// <returns></returns>
        Task<bool> Insert(AliPayBillEntity billEntity);
        /// <summary>
        /// 获取某一天支付宝对账单记录
        /// </summary>
        /// <param name="tradeDate">交易日期</param>
        /// <param name="aliPayBillType">支付宝支付账单类型</param>
        /// <returns></returns>
        Task<(IEnumerable<AliPayBillDetailEntity>, AliPayBillStatisticsEntity)> GetSomeDayBill(DateTime tradeDate, AliPayBillType? aliPayBillType);
        /// <summary>
        /// 获取某一月支付宝对账单记录
        /// </summary>
        /// <param name="year">年</param>
        /// <param name="month">月</param>
        /// <param name="aliPayBillType">支付宝支付账单类型</param>
        /// <returns></returns>
        Task<(IEnumerable<AliPayBillDetailEntity>, AliPayBillStatisticsEntity)> GetSomeMonthBill(int year, int month, AliPayBillType? aliPayBillType);
        /// <summary>
        /// 获取某一月支付宝对账单记录
        /// </summary>
        /// <param name="year">年</param>
        /// <param name="aliPayBillType">支付宝支付账单类型</param>
        /// <returns></returns>
        Task<(IEnumerable<AliPayBillDetailEntity>, AliPayBillStatisticsEntity)> GetSomeYearBill(int year, AliPayBillType? aliPayBillType);

        /// <summary>
        /// 获取账单详情
        /// </summary>
        /// <param name="paymentRecordId">支付记录Id</param>
        /// <returns></returns>
        Task<AliPayBillDetailEntity> GetEntityByPaymentRecordId(long paymentRecordId);
    }
}
